package com.yf.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.yf.dto.ContentFileWithTitle;
import com.yf.entity.CmsContentFileExample;
import com.yf.mapper.CmsContentFileMapper;
import com.yf.service.ContentFileService;

@Service
public class ContentFileServiceImpl implements ContentFileService{
	
	@Autowired
	private CmsContentFileMapper cmsContentFileMapper;

	@Override
	public List<ContentFileWithTitle> getContentFile() {
		CmsContentFileExample example=new CmsContentFileExample();
		example.createCriteria().andIsImageEqualTo(true);
		example.setOrderByClause("content_id DESC");
		//使用pagehelper进行分页查询
		PageHelper.startPage(1,5);
		List<ContentFileWithTitle> contentFileList=cmsContentFileMapper.selectWithTitleByExample(example);
		return contentFileList;
	}

}
